<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output method="text" encoding="iso-8859-1" />

<xsl:template match="/">
    
    <!-- ENSEIGNANTS -->
    <!--
    <xsl:for-each select="//DONNEES/INDIVIDUS/INDIVIDU">
INSERT INTO uni_enseignant (baseid, nom, prenom, id_siecle)
VALUES(1, '<xsl:value-of select="NOM_USAGE" />', '<xsl:value-of select="PRENOM" />', '<xsl:value-of select="@ID" />');        
    </xsl:for-each>
    -->
    
    <!-- SERVICES -->
    <!-- SERVICE DIVISIONS 
    <xsl:for-each select="//DONNEES/STRUCTURE/DIVISIONS/DIVISION/SERVICES/SERVICE/ENSEIGNANTS/ENSEIGNANT">
INSERT INTO uni_service_enseignant(baseid, enseignantid, matiereid, structureid, heures)
VALUES(1, getEnseignantIdByIdSiecle(1, '<xsl:value-of select="@ID" />'),
          getMatiereIdByIdSiecle(1, '<xsl:value-of select="../../@CODE_MATIERE" />'),
          getStructureIdByIdSiecle(1, '<xsl:value-of select="../../../../@CODE" />'),
          '<xsl:value-of select="../../HEURES_STRUCTURE" />');        
    </xsl:for-each>
    -->
    
    <!-- SERVICE GROUPES  -->
    <xsl:for-each select="//DONNEES/STRUCTURE/GROUPES/GROUPE/SERVICES/SERVICE/ENSEIGNANTS/ENSEIGNANT">
INSERT INTO uni_service_enseignant(baseid, enseignantid, matiereid, structureid, heures)
VALUES(1, getEnseignantIdByIdSiecle(1, '<xsl:value-of select="@ID" />'),
          getMatiereIdByIdSiecle(1, '<xsl:value-of select="../../@CODE_MATIERE" />'),
          getStructureIdByIdSiecle(1, '<xsl:value-of select="../../../../@CODE" />'),
          '<xsl:value-of select="../../HEURES_STRUCTURE" />');        
    </xsl:for-each>
</xsl:template>

</xsl:stylesheet>